<template>
  <div>
    <detail-header></detail-header>
    <detail-banner
      :sightName = 'this.sightName'
      :bannerImg = 'this.bannerImg'
      :gallaryImgs = 'this.gallaryImgs'
    ></detail-banner>
    <div class="container">
      <detail-list :categoryList='categoryList'></detail-list>
    </div>
  </div>
</template>
<script>
import detailBanner from './components/detailBanner'
import detailHeader from './components/detailHeader'
import detailList from './components/detailList'
import axios from 'axios'
export default {
  name: 'detail',
  components: {
    detailBanner,
    detailHeader,
    detailList
  },
  data () {
    return {
      sightName: '',
      bannerImg: '',
      gallaryImgs: [],
      categoryList: []
    }
  },
  methods: {
    getDetailInfo () {
      axios.get('static/mock/detail.json')
        .then(this.getInfoSucc)
    },
    getInfoSucc (res) {
      console.log(res.data)
      const data = res.data
      this.sightName = data.data.sightName
      this.bannerImg = data.data.bannerImg
      this.gallaryImgs = data.data.gallaryImgs
      this.categoryList = data.data.categoryList
    }
  },
  mounted () {
    this.getDetailInfo()
  }
}
</script>

<style lang='stylus' scoped>
  .container
    height:100rem
</style>
